import authMenuList from "@/assets/json/authMenuList.json";
import RequestHttp from "@/api/index";
import { PORT1 } from "@/api/config/servicePort";
import { loginResultData } from "@/api/interface/login";

/**
 * @name 用户登录模块
 */

export const loginApi = (params: { userName: string; password: string }) => {
  return RequestHttp.get<loginResultData>(`${PORT1}/api/Auth/AdminLogin`, params);
};

/**
 * @name 获取菜单列表
 */
export const getAuthMenuListApi = () => {
  return authMenuList;
};

/**
 * @name 退出登录
 */
export const logoutApi = (params: { token: string }) => {
  return RequestHttp.get(`${PORT1}/api/Auth/Logout`, params);
};
